{% extends "profile/base.html" %}

{% block title %}{{ error_code }} - {{ error_title }}{% endblock %}

{% block extra_css %}
<style>
    .error-container {
        text-align: center;
        padding: 80px 20px;
    }
    
    .error-code {
        font-size: 120px;
        font-weight: bold;
        color: {{ error_color or '#6c757d' }};
        line-height: 1;
        margin-bottom: 20px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    }
    
    .error-message {
        font-size: 24px;
        margin-bottom: 30px;
        color: #495057;
    }
    
    .error-description {
        font-size: 16px;
        color: #6c757d;
        margin-bottom: 40px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .error-actions {
        margin-top: 40px;
    }
    
    .error-icon {
        font-size: 64px;
        color: {{ error_color or '#6c757d' }};
        margin-bottom: 20px;
    }
    
    .error-card {
        background: white;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        padding: 40px;
        max-width: 800px;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
    }
    
    .error-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        background: linear-gradient(90deg, {{ error_color or '#6c757d' }}, {{ error_color_dark or error_color or '#6c757d' }});
    }
    
    .error-illustration {
        margin-bottom: 30px;
    }
    
    .btn-home {
        background: linear-gradient(45deg, #4361ee, #3f37c9);
        border: none;
        padding: 12px 30px;
        font-weight: 500;
        border-radius: 50px;
        transition: all 0.3s;
    }
    
    .btn-home:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 14px rgba(67, 97, 238, 0.3);
    }
    
    .btn-back {
        background-color: #f8f9fa;
        color: #495057;
        border: 1px solid #dee2e6;
        padding: 12px 30px;
        font-weight: 500;
        border-radius: 50px;
        transition: all 0.3s;
    }
    
    .btn-back:hover {
        background-color: #e9ecef;
        transform: translateY(-2px);
    }
    
    .error-details {
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 15px;
        margin: 20px 0;
        text-align: left;
        border-left: 4px solid {{ error_color or '#6c757d' }};
    }
    
    @media (max-width: 768px) {
        .error-code {
            font-size: 80px;
        }
        
        .error-message {
            font-size: 20px;
        }
        
        .error-card {
            padding: 30px 20px;
        }
    }
</style>
{% endblock %}

{% block content %}
<div class="error-container">
    <div class="error-card">
        <div class="error-illustration">
            <i class="fas {{ error_icon or 'fa-exclamation-circle' }} error-icon"></i>
        </div>
        
        <div class="error-code">{{ error_code or '错误' }}</div>
        <h1 class="error-message">{{ error_title or '发生错误' }}</h1>
        <p class="error-description">
            {{ error_description or '抱歉，处理您的请求时发生了错误。' }}
        </p>
        
        {% if error_details %}
        <div class="error-details">
            <p><strong>详细信息:</strong></p>
            <p class="mb-0">{{ error_details }}</p>
        </div>
        {% endif %}
        
        <div class="error-actions">
            <a href="{{ url_for('profile.dashboard') }}" class="btn btn-primary btn-home me-2">
                <i class="fas fa-home me-2"></i>返回首页
            </a>
            <button onclick="history.back()" class="btn btn-light btn-back">
                <i class="fas fa-arrow-left me-2"></i>返回上页
            </button>
        </div>
        
        <div class="mt-5">
            <h5>您可以尝试：</h5>
            <div class="row mt-3">
                <div class="col-md-4 mb-3">
                    <div class="card h-100 border-0 shadow-sm">
                        <div class="card-body text-center">
                            <i class="fas fa-redo fa-3x text-warning mb-3"></i>
                            <h6 class="card-title">刷新页面</h6>
                            <button onclick="location.reload()" class="btn btn-sm btn-outline-warning">刷新</button>
                        </div>
                    </div>
                </div>
                <div class="col-md-4 mb-3">
                    <div class="card h-100 border-0 shadow-sm">
                        <div class="card-body text-center">
                            <i class="fas fa-home fa-3x text-primary mb-3"></i>
                            <h6 class="card-title">返回首页</h6>
                            <a href="{{ url_for('profile.dashboard') }}" class="btn btn-sm btn-outline-primary">首页</a>
                        </div>
                    </div>
                </div>
                <div class="col-md-4 mb-3">
                    <div class="card h-100 border-0 shadow-sm">
                        <div class="card-body text-center">
                            <i class="fas fa-search fa-3x text-info mb-3"></i>
                            <h6 class="card-title">搜索内容</h6>
                            <a href="{{ url_for('profile.dashboard') }}" class="btn btn-sm btn-outline-info">搜索</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}